package com.leoman.plz_p.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.leoman.plz_p.R;
import com.leoman.plz_p.module.bean.CourseCommentBean;
import com.leoman.plz_p.weidget.RoundedTransformationBuilder;

import cn.com.corelib.utils.adapter.BaseAdapterHelper;
import cn.com.corelib.utils.adapter.normal.QuickAdapter;

/**
 * Created by guoh on 2018/8/13.
 */
public class CourseCommentAdapter extends QuickAdapter<CourseCommentBean> {
    public CourseCommentAdapter(Context context) {
        super(context, R.layout.item_comment);
    }

    @Override
    protected void convert(BaseAdapterHelper helper, CourseCommentBean item, int position) {
        Glide.with(context).load(item.getHeadimg()).centerCrop().transform(new CenterCrop(context), new RoundedTransformationBuilder().oval(true).build(context)).into((ImageView) helper.getView(R.id.iv_head));
        helper.setText(R.id.tv_name,item.getName())
                .setText(R.id.tv_time,item.getCreateDate())
                .setText(R.id.tv_content,item.getContent());
    }
}
